﻿using MediatR;
using System.CJL.API.Application.Command.RawMaterialCommand;
using System.CJL.Domain;
using System.CJL.Infrstructre.Interface;

namespace System.CJL.API.Application.CommandHanlder.RawMaterialCommandHanler
{
    /// <summary>
    /// 原料返填
    /// </summary>
    public class RawMaterialModelCommandHandler : IRequestHandler<RawMaterialModelCommand, RawMaterial>
    {
        IRawMaterialRepository _repository;
        /// <summary>
        /// 构造函数
        /// </summary>
        public RawMaterialModelCommandHandler(IRawMaterialRepository repository)
        {
            _repository = repository;
        }
        /// <summary>
        /// 原料返填
        /// </summary>
        public async Task<RawMaterial> Handle(RawMaterialModelCommand request, CancellationToken cancellationToken)
        {
            return await _repository.GetMondel(request.id);
        }
    }
}
